package com.sdvdxl.util;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;

public interface DB<T> {
	/**
	 * 预处理sql语句
	 * @param sql 要预处理的sql语句
	 * @throws SQLException 
	 */
	void prepareSql(String sql) throws SQLException;
	
	/**
	 * 执行预处理的语句
	 * @return 返回影响的行数
	 */
	int execute();
	
	/**
	 * 原始结果集
	 * @return 数据集
	 * @throws SQLException 
	 */
	ResultSet executeQuery() throws SQLException;
	
	void setString(int index, String value)  throws SQLException;
	void setDouble(int index, Double value)  throws SQLException;
	void setFloat(int index, Float value)  throws SQLException;
	void setDate(int index, Date value)  throws SQLException;
	void setLong(int index, Long value)  throws SQLException;
	void setTimestamp(int index, Timestamp value)  throws SQLException;
	void setObject(int index, Object value)  throws SQLException;
}
